package com.boho.system.action;


             
/**
 * 
 *
 * @File name:  UpdateTSysUserRoleAction.java   修改【系统用户角色:T_USER_ROLE】
 * @Create on:  2010-05-10 11:27:234
 * @Author   :  陈伟
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 */
           
        


            


import cn.boho.framework.actions.ActionImp;
import cn.boho.framework.context.ActionContext;
import cn.boho.framework.exception.UserOperationException;
import cn.boho.framework.service.MessageService;

import com.boho.system.service.PermissionService;
            
        
public class UpdateTSysUserRoleAction extends ActionImp {
	
	@Override
	protected void doException(ActionContext atx, Exception ex) {
		if (!(ex instanceof UserOperationException)) {
			atx.setErrorContext("BOHO_COMMON_1002", MessageService.getMessage("BOHO_COMMON_1002"),"【系统用户角色】" ,ex);
		}
	}
	@Override
	protected int performExecute(ActionContext atx) throws Exception {
		Integer userid = atx.getIntegerValue("PK_SYS_USER",0);
		Integer[] roleids = (Integer[])atx.getArrayValue("ROLE_ID");
		PermissionService.updateUserRole(atx, userid, roleids);
		return 1;
	}
	@Override
	protected int verifyParameters(ActionContext atx) throws Exception {
		return 1;
	}
}
